// 物料接收管理的api接口
import { $post } from '@/utils/request';
import {
  searchWorkerCodeParams,
  changeAccTypeParams,
  changeReturnTypeParams,
  searchByBarcodeParams,
  scanningHandoverParams,
  partWorkbinOutStoreroomParams,
  searchWmsDelCoParams,
  updateWmsDeliveryCoParams,
  deletDtoParams,
  searchDeliverPlanParams,
  insertDtoParams,
  searchByOutParams,
  searchByPageParams,
  searchPlanByItemTypeZParams,
  saveRemarkParams,
  searchMaterialParams,
  searchParamsByBarcodeParams,
  searchParamsByReturnParams,
  searchParamsByDeliveryParams,
  creatReturnSalesParams,
  submitReturnSalesParams,
  updateReturnSalesParams,
  standardReturnQueryParams,
  selectDeliverPlanStandardParams,
  searchDeliveryReceivedParams,
  searchReceDetailParams,
  // searchBZJCodeParams,
  finWorkbinOutStoreroomParams,
  // searchByBackParams,
  workbinOutStoreroomParams,
  updateRepairParams,
  searchAwaitStorageParams,
  PWacdfimnoorrssParams,
  prtFrtHcxScanParams,
  prMaterialOutParams,
  standardReturnSaveParams,
  newFinWorkbinOutStoreroomParams,
  searchBarCodeParams,
} from './types';

// 扫码移交功能
export function searchWorkerCode(data: searchWorkerCodeParams) {
  return $post('/WmsDeliverPlan/searchWorkerCode', data);
}

// 扫物料功能
export function changeAccType(data: changeAccTypeParams) {
  return $post('/WmsDeliverPlan/changeAccType', data);
}

// 扫码退回功能
export function changeReturnType(data: changeReturnTypeParams) {
  return $post('/WmsDeliverPlan/changeRetrunType', data);
}

// 扫码零件接收
export function searchByBarcode(data: searchByBarcodeParams) {
  return $post('/partReceive/searchByBarcode', data);
}

// 扫码成品接收
export function searchByFin(data: searchByBarcodeParams) {
  return $post('/finProReceiveSearch/searchByBarcode', data);
}

// 扫码标件接收
export function searchBZJCode(data: searchBarCodeParams) {
  return $post('/BZJReceiveRest/searchBZJCode', data);
}
// export function searchBZJCode(data: searchBZJCodeParams) {
//   return $post('/BZJReceiveRest/searchBZJCode', data);
// }

// 扫码退库接收
export function searchByBack(data: searchByBarcodeParams) {
  return $post('/BackReceive/searchByBarcode', data);
}

// 零件接收-输入操作码后更改状态
export function partWorkbinOutStoreroom(data: partWorkbinOutStoreroomParams) {
  return $post('/receiveCallWorkbin/partWorkbinOutStoreroom', data);
}

// 成品接收-输入操作码后更改状态
export function finWorkbinOutStoreroom(data: finWorkbinOutStoreroomParams) {
  return $post('/receiveCallWorkbin/finWorkbinOutStoreroom', data);
}

// 标件接收-输入操作码后更改状态
export function bzjScanRecive(data: newFinWorkbinOutStoreroomParams) {
  return $post('/BZJReceiveRest/bzjScanRecive', data);
}

// 退库接收-输入操作码后更改状态
export function workbinOutStoreroom(data: workbinOutStoreroomParams) {
  return $post('/outStoreroom/workbinOutStoreroom', data);
}

// 扫码移交查询
export function scanningHandover(data: scanningHandoverParams) {
  return $post('/WmsDeliverPlan/searchByParams', data);
}

// 协调单查询
export function searchWmsDelCo(data: searchWmsDelCoParams) {
  return $post('/WmsDeliveryCo/searchWmsDelCo', data);
}
// 协调单提交
export function updateWmsDeliveryCo(data: updateWmsDeliveryCoParams) {
  return $post('/WmsDeliveryCo/updateWmsDeliveryCo', data);
}
// 协调单删除
export function deletDto(data: deletDtoParams) {
  return $post('/WmsDeliveryCo/deletDto', data);
}
// 新增协调单弹框查询
export function searchDeliverPlan(data: searchDeliverPlanParams) {
  return $post('/WmsDeliveryCo/searchDeliverPlan', data);
}
// 新增协调单弹框问题查询
export function searchProblemType(data: any) {
  return $post('/WmsDeliveryCo/searchProblemType', data);
}
// 新增协调单
export function insertDto(data: insertDtoParams) {
  return $post('/WmsDeliveryCo/insertDto', data);
}

// 扫码退回查询
export function searchByOut(data: searchByOutParams) {
  return $post('/WmsDeliverPlan/searchByParams', data);
}

// 零件、产品接收查询
export function searchByPage(data: searchByPageParams) {
  return $post('/WmsDeliverPlan/searchByPage', data);
}

// 标准件接收查询
export function searchPlanByItemTypeZ(data: searchPlanByItemTypeZParams) {
  return $post('/WmsDeliverPlan/searchPlanByItemTypeZ', data);
}

// 零件、产品录入备注
export function saveRemark(data: saveRemarkParams) {
  return $post('/WmsDeliverPlan/saveRemark', data);
}

// 退库列表查询
export function searchMaterial(data: searchMaterialParams) {
  return $post('/BackReceive/searchMaterail', data);
}

// 退库已接收列表查询
export function searchParamsByBarcode(data: searchParamsByBarcodeParams) {
  return $post('/partReceive/searchParamsByBarcode', data);
}

// 物料入库列表查询,字段与标准件接收查询一致
export function searchBeputMaterial(data: searchPlanByItemTypeZParams) {
  return $post('/WmsDeliverPlan/searchBeputMaterial', data);
}

// 物料入库扫码时返回大件货物库位号
export function searchLocatorNo(data: any) {
  return $post('/materialReceipt/searchLocatorNo', data);
}

// 查看缓存箱
export function queryReceiveGkLog(data: any) {
  return $post('/materialReceipt/queryReceiveGkLog', data);
}

// 零件退货查询
export function searchParamsByReturn(data: searchParamsByReturnParams) {
  return $post('/partSalesReturn/searchParamsByReturn', data);
}

// 零件所在单位发起—查询
export function searchParamsByDelivery(data: searchParamsByDeliveryParams) {
  return $post('/partSalesReturn/searchParamsByDelivery', data);
}

// 零件所在单位保存新增
export function creatReturnSales(data: creatReturnSalesParams[]) {
  return $post('/partSalesReturn/creatReturnSales', {'data': data});
}

// 零件退货提交
export function submitReturnSales(data: submitReturnSalesParams) {
  return $post('/partSalesReturn/submitReturnSales', data);
}

// 零件退货删除
export function deleteReturnApplyByIds(data: submitReturnSalesParams) {
  return $post('/partSalesReturn/deleteReturnApplyByIds', data);
}

// 零件退货修改
export function updateReturnApply(data: updateReturnSalesParams) {
  return $post('/partSalesReturn/updateReturnApply', data);
}

// 成品退货查询
export function searchParamsByProductReturn(data: searchParamsByReturnParams) {
  return $post('/partSalesReturn/searchParamsByProductReturn', data);
}

// 成品所在单位发起—查询
export function searchParamsByDeliveryProduct(
  data: searchParamsByDeliveryParams
) {
  return $post('/partSalesReturn/searchParamsByDeliveryProduct', data);
}

// 标准件退货查询
export function standardReturnQuery(data: standardReturnQueryParams) {
  return $post('/StandardSalesReturnRest/standardReturnQuery', data);
}

// 标准件退货查询
export function selectDeliverPlanStandard(
  data: selectDeliverPlanStandardParams
) {
  return $post('/StandardSalesReturnRest/selectDeliverPlanStandard', data);
}

//  标准件所在单位发起—保存
export function standardReturnSave(data: standardReturnSaveParams) {
  return $post('/StandardSalesReturnRest/standardReturnSave', data);
}

// 已叫料箱查询
export function searchDeliveryReceived(data: searchDeliveryReceivedParams) {
  return $post('/ReceivedDeliveryPlan/searchDeliveryReceived', data);
}

// 已叫料箱查看缓存料箱
export function searchReceDetail(data: searchReceDetailParams) {
  return $post('/ReceivedDeliveryPlan/searchReceDetail', data);
}

// 回退交接单
export function backDeliverys(data: any) {
  return $post('/materialReceipt/backDeliverys', data);
}

// 漏扫物料
export function updateRepair(data: updateRepairParams) {
  return $post('/materialReceipt/updateRepair', data);
}

// 继续执行
export function receiveGoingOn(data: any) {
  return $post('/taskGoOn/receiveGoingOn', data);
}

// 缓存箱扫码
export function searchAwaitStorage(data: searchAwaitStorageParams) {
  return $post('/materialReceipt/searchAwaitStorage', data);
}

// 一键确认更改状态
export function PWacdfimnoorrss(data: PWacdfimnoorrssParams) {
  return $post('/materialReceipt/confirmPassWord', data);
}

// 物料入库-大件物料下拉列表接口
export function searchWorkbinXl(data: any) {
  return $post('/materialReceipt/searchLocatorNo', data);
}

// 物料入库的物料入库按钮接口
export function materialReceipt(data: any) {
  return $post('/materialReceipt/materialReceipt', data);
}

// 查看缓存箱
export function searchWorkbinMaterial(data: any) {
  return $post('/partSalesReturn/searchWorkbinMaterial', data);
}

// 物料入库-----缓存箱入库接口
export function bufferBoxWarehousing(data: any) {
  return $post('/inStoreroom/inStoreroomQuery', data);
}

// 物料入库获取类型
export function typeWarehousing(data: any) {
  return $post('InventoryDetailsController/getMaterial', data);
}

// 零件退货---缓存箱扫码接口
export function prtFrtHcxScan(data: prtFrtHcxScanParams) {
  return $post('/outBill/outBillQuery', data);
}

// 零件退货-物料出库按钮
export function prMaterialOut(data: prMaterialOutParams) {
  return $post('/outBill/insertWmsInvOutBill', data);
}

// 成品接收-查备注
export function getActionContent(data: any) {
  return $post('/WmsDeliverPlan/setDefaultNotes', data);
}

// 二次配套查询
export function getSecondaryMatching(data: any) {
  return $post('', data);
}
